package com.spa.application.dto.admin;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.spa.application.converter.AmountIntegerToYuanConverter;
import lombok.Data;

import java.util.Date;

@Data
@JsonInclude
public class CityExportDTO {

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ExcelProperty(value = "ID")
    @ColumnWidth(20)
    private Long id;

    @ExcelProperty(value = "城市名称")
    @ColumnWidth(20)
    private String cityName;

    @ExcelProperty(value = "所属省份")
    @ColumnWidth(20)
    private String region;

    @ExcelProperty(value = "状态")
    @ColumnWidth(20)
    private String status;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty(value = "开通时间")
    @ColumnWidth(20)
    private Date openTime;

    @ExcelProperty(value = "起步里程")
    @ColumnWidth(20)
    private String distance;

    @ExcelProperty(value = "起步价",converter = AmountIntegerToYuanConverter.class)
    @ColumnWidth(20)
    private Integer price;

    @ExcelProperty(value = "每公里加价",converter = AmountIntegerToYuanConverter.class)
    @ColumnWidth(20)
    private Integer incrementPrice;

    public void setDistance(String distance) {
        this.distance = distance+"公里";
    }
}
